#ifndef CONTROLPANEL_H
#define CONTROLPANEL_H

#include <QFrame>
#include <QMovie>

namespace Ui {
class ControlPanel;
}

class ControlPanel : public QFrame
{
    Q_OBJECT

public:
    explicit ControlPanel(QWidget *parent = nullptr);
    ~ControlPanel();

protected:
    bool eventFilter(QObject *watched, QEvent *event) override;

public:

    void setStyle(QString bac_color,QString shadow_color,qint64 radius = 10);
    void setBasicTemplate(QString bac_color, QString shadow_color, QString titel, QString state,QString gif,QString color = "#000000");
    void setPlugsToView(QWidget *widget);

    void setGif(QString gif_path);
    void Off();
    void On();

    void setState(QString state,QString color = "#000000");

    void setTitel(QString titel,QString color = "#000000");

    void setCtrl(QChar icon,QString color = "#000000");

    void disableCtrl(bool is_disable);

    /**
     * @brief 设置控制板状态
     * @param state
     */
    void setState(bool state);

Q_SIGNALS:
    void sendData(QString data);

private:
    Ui::ControlPanel *ui;
    QMovie * m_gif_movie;
    bool m_ctrl_state;
    bool m_ctrl_disable;
    QString cmd;
};

#endif // CONTROLPANEL_H
